//
//  NSDate+XDTimerFormatter.m
//  tangchengyipin
//
//  Created by XiangDongMBP on 16/2/27.
//  Copyright © 2016年 XiangDong. All rights reserved.
//

#import "NSDate+XDTimerFormatter.h"

@implementation NSDate (XDTimerFormatter)

- (NSString *)xd_yyyyMMddHHmmss {
    NSDateFormatter * formatter = [[NSDateFormatter alloc] init];
    formatter.dateFormat = @"yyyy-MM-dd HH:mm:ss";
    return [formatter stringFromDate:self];
}

- (NSString *)xd_yyyyMMdd {
    NSDateFormatter * formatter = [[NSDateFormatter alloc] init];
    formatter.dateFormat = @"yyyy年MM月dd日";
    return [formatter stringFromDate:self];
}

- (NSString *)xd_enWeek {
    NSDateFormatter * formatter = [[NSDateFormatter alloc] init];
    [formatter setLocale:[[NSLocale alloc] initWithLocaleIdentifier:@"en_US"]]; // 防止输出是中文
    formatter.dateFormat = @"ccc";
    return [formatter stringFromDate:self];
}

@end
